
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2431. -- [HAOI2009]逆序对数列 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2431: [HAOI2009]逆序对数列</h2><span class=green>Time Limit: </span>5 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>162&nbsp;&nbsp;<span class=green>Solved: </span>87<br>[<a href='submitpage.php?id=2431'>Submit</a>][<a href='problemstatus.php?id=2431'>Status</a>][<a href='bbs.php?id=2431'>Discuss</a>]</center><h2>Description</h2><div class=content><p class="MsoNormal" style="text-indent:21.75pt"><span style="font-size:12.0pt;
mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">对于一个数列</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt">{a<sub>i</sub>}</span><span style="font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，如果有</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt">i&lt;j</span><span style="font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">且</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt">a<sub>i</sub>&gt;a<sub>j</sub></span><span style="font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，那么我们称</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt">a<sub>i</sub></span><span style="font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">与</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt">a<sub>j</sub></span><span style="font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">为一对逆序对数。若对于任意一个由</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt">1~n</span><span style="font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">自然数组成的数列，可以很容易求出有多少个逆序对数。那么逆序对数为</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt">k</span><span style="font-size:12.0pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">的这样自然数数列到底有多少个？</span><span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:10.0pt"><o:p></o:p></span></p>
<p></p></div><h2>Input</h2><div class=content><p class="MsoNormal" style="text-indent: 21.75pt; "><span lang="EN-US" style="font-size: 12pt; "><o:p>&nbsp;</o:p></span><span style="font-size: 12pt; font-family: 宋体; ">第一行为两个整数</span><span lang="EN-US" style="font-size: 12pt; ">n</span><span style="font-size: 12pt; font-family: 宋体; ">，</span><span lang="EN-US" style="font-size: 12pt; ">k</span><span style="font-size: 12pt; font-family: 宋体; ">。</span><span lang="EN-US" style="font-size: 12pt; "><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 24pt; "></p>
<p class="MsoNormal" style="text-indent: 24pt; "></p>
<p></p></div><h2>Output</h2><div class=content><p class="MsoNormal" style="text-indent: 24pt; "><span style="font-size: 12pt; font-family: 宋体; ">写入一个整数，表示符合条件的数列个数，</span><span style="font-size: 12pt; font-family: 宋体; ">由于这个数可能很大，你只需输出该数对</span><span lang="EN-US" style="font-size: 12pt; ">10000</span><span style="font-size: 12pt; font-family: 宋体; ">求余数后的结果。</span></p>
<p class="MsoNormal" style="text-indent: 24pt; "><span lang="EN-US" style="font-size: 12pt; "><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><br />
</b></p>
<p class="MsoNormal" style="text-indent: 24pt; "></p>
<p></p></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>样例输入<br />
<br />
   4 1<br />
<br />
 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>样例输出<br />
<br />
3<br />
<br />
样例说明：<br />
<br />
下列3个数列逆序对数都为1；分别是1 2 4 3 ；1 3 2 4 ；2 1 3 4；<br />
<br />
 <br />
<br />
测试数据范围<br />
<br />
30%的数据  n<=12<br />
<br />
100%的数据  n<=1000，k<=1000</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=Day1'>Day1</a></p></div><center>[<a href='submitpage.php?id=2431'>Submit</a>][<a href='problemstatus.php?id=2431'>Status</a>][<a href='bbs.php?id=2431'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
